package com.company.cloud.common.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 租户holder
 */
public class TenantContextHolder {
	
	private static final ThreadLocal<String> CONTEXT = new TransmittableThreadLocal<String>();

	public static void setTenant(String tenant) {
		CONTEXT.set(tenant);
	}

	public static String getTenant() {
		return CONTEXT.get();
	}

	public static void clear() {
		CONTEXT.remove();
	}
}
